using AutoMapper;
using UwinEducation.Application.Dtos.Orders;
using UwinEducation.Domain.Entities;

namespace UwinEducation.Application.Mappings
{
    /// <summary>
    /// 订单详情映射配置
    /// </summary>
    public class OrderDetailProfile : Profile
    {
        public OrderDetailProfile()
        {
            CreateMap<OrderDetail, OrderDetailDto>()
                .ForMember(dest => dest.TeacherSchedule, opt => opt.MapFrom(src => src.TeacherSchedule))
                .ForMember(dest => dest.Student, opt => opt.MapFrom(src => src.Student));

            CreateMap<CreateOrderDetailDto, OrderDetail>();
            CreateMap<UpdateOrderDetailDto, OrderDetail>();
        }
    }
} 